<SCRIPT type="text/javascript" src="/view/javascripts/form.js"></SCRIPT>

<DIV class="block">
	<H1>

	<?php echo $response->getParameter('title');?></H1>
	
	
	
	
<?php
	if($response->isParameter('types')) {
?>
	<UL class="tabs">
<?php
		foreach($response->getParameter('types') as $type) {
			$id = $type->getIdentity();
			$name = $type->getName();
?>
		<LI class="inactive">
			<FORM class="hidden" id="form-<?php echo $id;?>" action="/monitoring/index.html" method="post">
				<INPUT type="hidden" name="identity" value="<?php echo $id;?>">
			</FORM>
			<A href="#" onclick="submitForm('form-<?php echo $id;?>')"><?php echo $name;?></A>
		</LI>
<?php
			
		}
?>

		<LI class="active"><STRONG>Университет</STRONG></LI>
	</UL>
<?php
	}
?>
</DIV>
<DIV id="year">


<?php
$year = (int)unserialize($_SESSION['year']);
?>
	<FORM action="/monitoring/indicator/indicatorAvgVal.html" method="post">
		<INPUT type="hidden" name="year" value="<?php echo $year-1;?>"> <INPUT
			type="submit" value="&lt;&lt;&lt;">
	</FORM>
	
<?php
	echo $year;
	if ($year < date("Y")) {
?>
	<FORM action="/monitoring/indicator/indicatorAvgVal.html" method="post">
		<INPUT type="hidden" name="year" value="<?php echo $year+1;?>">
		<INPUT type="submit"  value="&gt;&gt;&gt;">
	</FORM>
<?php
	}
?>
</DIV>
<DIV class="block">
	<TABLE>
		<TR>
			<TH rowspan="3">Показатель</TH>
			<TH rowspan="3">Весомость</TH>
			<TH colspan="8">Квартал календарного года</TH>
		</TR>
		<TR>
			<TH colspan="2">I</TH>
			<TH colspan="2">II</TH>
			<TH colspan="2">III</TH>
			<TH colspan="2">IV</TH>
		</TR>
		<TR>
			<TH>план</TH>
			<TH>факт</TH>
			<TH>план</TH>
			<TH>факт</TH>
			<TH>план</TH>
			<TH>факт</TH>
			<TH>план</TH>
			<TH>факт</TH>
		</TR>

<?php
$avg = $response->getParameter('avg');
$indicators = $response->getParameter('indicators');
foreach($indicators as $indicator) {
	$id = $indicator->getIdentity();
	
	?>
			<TR >
				<TD><?php echo $indicator->getName();?></TD>
				<TD><?php echo $indicator->getWeight();?></TD>
				<?php for ($q = 1; $q <= 4 ; $q++) {
					//плановое значение
					echo "<TD>";
						if(isset($avg[$id][$q]) && $avg[$id][$q]!=0) {
							echo "100%";
						} else {
							echo "-";
						}
					echo"</TD>";
					//фактическое значение
					echo "<TD>";
					if(isset($avg[$id][$q+4]) && $avg[$id][$q]!=0) {
						echo round($avg[$id][$q+4],2); echo "%";
					} else {
						echo "-";
					}
					echo"</TD>";
				} ?>
				
			</TR>
			<?php
 }//foreach indicator
?>
	</TABLE>
</DIV>
